﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fx.Mvc.Security.Entities;
using FluentNHibernate.Mapping;

namespace Fx.Mvc.Security.Maps
{
    public abstract class TokenMap : ClassMap<Token>
    {
        public TokenMap()
        {
            Schema("admin");
            Table("Tokens");
            Id(x => x.Id).GeneratedBy.Identity();
            Map(x => x.UserName).Not.Nullable();
            Map(x => x.Data).Not.Nullable();
            Map(x => x.Ip).Not.Nullable();
            Map(x => x.LoginTime).Not.Nullable();
            Map(x => x.ExpiredTime).Not.Nullable();
            Map(x => x.IsExpired);
        }
    }
}
